﻿<!-- 
    To remove border: http://weblogs.asp.net/psheriff/archive/2009/10/12/creating-border-less-windows-in-wpf.aspx 
 -->
<Window x:Class="GrooveSharp.GrooveSharpMainWindow"
        xmlns:local="clr-namespace:GrooveSharp"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MP3 Player" 
        Height="800" Width="600" 
        Topmost="False" 
        ResizeMode="CanResizeWithGrip" 
        WindowStartupLocation="CenterScreen" 
        WindowState="Maximized" 
        WindowStyle="None" 
        AllowsTransparency="True" 
        Background="Transparent" 
        AllowDrop="True"
        Drop="Window_Drop"
        PreviewMouseMove="Window_PreviewMouseMove"
        PreviewTextInput="Window_PreviewTextInput" 
        Loaded="Window_Loaded"
        StateChanged="Window_StateChanged" 
        LocationChanged="Window_LocationChanged" 
        SizeChanged="Window_SizeChanged" 
        Closed="Window_Closed"
        >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources\GlassButton.xaml"/>
                <ResourceDictionary Source="Resources\GoldTabControl.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <DockPanel LastChildFill="True" Background="Black" Name="panelMain">
        <UniformGrid DockPanel.Dock="Top" Columns="3" MinHeight="16" Margin="0,8,8,0" Name="panelHeader">
            <StackPanel/>
            <StackPanel>
                <Image Name="imageMoveGrip" Source="/GrooveSharp;component/Images/movegrip_small.png" Stretch="None"
                       MouseLeftButtonUp="moveGripImage_MouseLeftButtonUp" 
                       MouseLeftButtonDown="moveGripImage_MouseLeftButtonDown" 
                       MouseMove="moveGripImage_MouseMove" 
                       MouseLeave="moveGripImage_MouseLeave" />
            </StackPanel>
            <StackPanel Background="Black" Orientation="Horizontal" HorizontalAlignment="Right" Name="topStack">
                <Button Name="buttonCompact"  Style="{StaticResource GlassButtonSmall}" 
                        Click="buttonCompact_Click" ToolTip="Compact player">
                    <Image Source="/Images/ministate.gif" Style="{StaticResource ImageForSmall}" />
                </Button>
                <Button Name="buttonState"  Style="{StaticResource GlassButtonSmall}" 
                        Click="buttonState_Click" ToolTip="Change application size">
                    <Image Source="/Images/state.gif" Style="{StaticResource ImageForSmall}" />
                </Button>
                <Button Name="buttonExit"  Style="{StaticResource GlassButtonSmall}" 
                        Click="buttonExit_Click" ToolTip="Exit the application">
                    <Image Source="/Images/exit.gif" Style="{StaticResource ImageForSmall}" />
                </Button>
            </StackPanel>
        </UniformGrid>
        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Name="bottomStack">
            <Button Name="buttonPrev" Style="{StaticResource GlassButtonLarge}" Click="buttonPrev_Click" 
                        ToolTip="Go to previous song">
                <Image Source="/Images/prev.gif" Name="imagePrev" Style="{StaticResource ImageForLarge}" />
            </Button>
            <Button Name="buttonPause" Style="{StaticResource GlassButtonLarge}" Click="buttonPause_Click" 
                        ToolTip="Pause or play">
                <Image Source="/Images/pause.gif" Name="imagePlayPause" Style="{StaticResource ImageForLarge}" />
            </Button>
            <Button Name="buttonNext" Style="{StaticResource GlassButtonLarge}" Click="buttonNext_Click" 
                        ToolTip="Go to next song">
                <Image Source="/Images/next.gif" Name="imageNext" Style="{StaticResource ImageForLarge}" />
            </Button>
            <Button Content="Test" Name="buttonTest" Style="{StaticResource GlassButtonLarge}"
                        Visibility="Collapsed" 
                        Click="buttonTest_Click"  />
        </StackPanel>


        <local:MainPlayer x:Name="theMainPlayer" DockPanel.Dock="Bottom" 
                          VerticalAlignment="Stretch" 
                          VerticalContentAlignment="Center" 
                          MusicEnd="theMainPlayer_MusicEnd" 
                          MusicFade="theMainPlayer_MusicFade" 
                          MusicStart="theMainPlayer_MusicStart" 
                          />

        <Grid Name="switchPanel">
            <!-- 
                This panel contains two controls, either one of them is visible:
                2) the compact player meant to be small and on top of all other things
                1) the normal player full UI (which can be either maximized or resized)
            -->
            <local:CompactInfo x:Name="theCompactInfo" Visibility="Collapsed" RatingChanged="theCompactInfo_RatingChanged"></local:CompactInfo>
            <TabControl Name="mainTabControl" Background="Black" Foreground="White" BorderBrush="Black" BorderThickness="0.4"
                        SelectionChanged="mainTabContro1_SelectionChanged" >
                <TabItem Header="Playing" Name="tabItemPlayer">
                    <local:FullScreenInfo x:Name="theNormalInfo" RatingChanged="theNormalInfo_RatingChanged" />
                </TabItem>
                <TabItem Header="Collection" Name="tabItemCollection">
                    <local:MusicCollection  x:Name="theCollection" AddTrack="MusicCollection_AddTrack" />
                </TabItem>
                <TabItem Header="Play List" Name="tabItemCurrentPlayList">
                    <local:CurrentPlayList x:Name="theCurrentPlayList"
                            PlayOtherTrack="theCurrentPlayList_PlayOtherTrack" 
                            RatingChanged="theCurrentPlayList_RatingChanged" />
                </TabItem>
                <TabItem Header="Settings" Name="tabItemSettings">
                    <local:ConfigurationEditor x:Name="theConfigurationEditor" />
                </TabItem>
                <TabItem Header="Help" Name="tabItemHelp">
                    <local:HelpText x:Name="helpText"  />
                </TabItem>
            </TabControl>
        </Grid>
    </DockPanel>

</Window>
